﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CourseSystem.Core.Entities;
using CourseSystem.Core.SqlServerDAL;

namespace CourseSystem.Core.BLL
{
    public class CourseGuideMenuBLL
    {
        public static List<CourseGuideMenuInfo> GetAll()
        {

            return GetList().ToList();

        }

        public static IQueryable<CourseGuideMenuInfo> GetList()
        {
            using (var dal = new CourseGuideMenuDAL(Settings.ConnectionName))
            {
                return dal.SelectQueryable(o => true).OrderBy(o => o.OrderId);
            }
        }

        public static CourseGuideMenuInfo Get(int id)
        {
            using (var dal = new CourseGuideMenuDAL(Settings.ConnectionName))
            {
                return dal.SelectSingle(o => o.Id == id);
            }
        }
    }
}
